package com.example.jishi.demos.web.service.impl;

import com.example.jishi.demos.web.entity.WorkLog;
import com.example.jishi.demos.web.mapper.WorkLogMapper;
import com.example.jishi.demos.web.service.WorkLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WorkLogServiceImpl implements WorkLogService {
    @Autowired
    private WorkLogMapper workLogMapper; // 自动通过构造函数注入

    @Override
    public List<WorkLog> getAllWorkLogs(String name, String keyword) {
        return workLogMapper.getAllWorkLogs(name, keyword);
    }

    @Override
    public WorkLog getWorkLogById(int id) {
        return workLogMapper.getWorkLogById(id);
    }

    @Override
    public void addWorkLog(WorkLog WorkLog) {
        workLogMapper.insertWorkLog(WorkLog);
    }

    @Override
    public void updateWorkLog(WorkLog WorkLog) {
        workLogMapper.updateWorkLog(WorkLog);
    }

    @Override
    public void deleteWorkLog(int id) {
        workLogMapper.deleteWorkLog(id);
    }
}
